#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <set>

using namespace std;


void get(int index, int lo, int hi, int size, vector<vector<int> > &ans, vector<int> &cur)
{
    if (index == size) {
        ans.push_back(cur);
        return;
    }

    if ( lo > hi) return;

    for (int i = lo; i <= hi; i++) {
        cur.push_back(i);
        get(index+1, i+1, hi, size, ans, cur);
        cur.pop_back();
    }
}

class Solution {
    public:
        vector<vector<int> > combine(int n, int k) {
            vector<vector<int> > ans;
            if (k > n) return ans;
            vector<int> cur;
            get(0, 1, n, k, ans, cur);
            return ans;
        }
};

//test in 1337 online judge and pass all the test
int main(int argc, char **argv)
{
    Solution mySolution;

    cout << "-----------------Test 1--------------------" << endl;
    vector<vector<int> > result = mySolution.combine(1 ,1);
    for (int i = 0; i < result.size(); i++)  {
        for (int j = 0; j < result[i].size(); j++)
            cout << result[i][j] << " ";
        cout << endl;
    }



    cout << "-----------------Test 2--------------------" << endl;


    cout << "-----------------Test 3--------------------" << endl;


    cout << "-----------------Test 4--------------------" << endl;


    cout << "-----------------Test 5--------------------" << endl;



}
